package com.wave.wavesystem.business.exception;

 import wave.common.exception.WaveBusinessException;
 import wave.common.pojo.entity.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 夕下风波
 * @date 2025-02-02 01:26
 * @description
 */
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {

    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);

    @ExceptionHandler(value = WaveBusinessException.class)
    public Result<String> SystemErrorHandler(WaveBusinessException exception) {
        return Result.exception(exception);
    }

}
